package com.syp.hehe.web;

/**
 * WEB响应码
 * @author syp
 *
 */
public enum WebappRetCodeEnum {
	
	SUCCESS("NOMARL", "正常的响应码。"),
	NO_SESSION("NO_SESSION", "session为空或已失效。"),
	NO_AUTH("NO_AUTH", "访问了一个有权限的资源。"),
	FAILURE("FAILURE", "系统繁忙，请稍后重试。");

	private String code;
	private String desc;

	private WebappRetCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}
	
	public static WebappRetCodeEnum getEnum(String code){
		for(WebappRetCodeEnum item : WebappRetCodeEnum.values()){
			if(item.getCode().equals(code)){
				return item;
			}
		}
		return null;
	}

}
